<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">

<head>
    <th:block th:include="common/common_head :: commonHeader('订单管理')"/>
    <link rel="stylesheet" th:href="@{/static/js/plugins/jquery-layout/jquery.layout-latest.css}">
    <link rel="stylesheet" th:href="@{/static/js/editable/css/bootstrap-editable.css}">
    <!-- <style type="text/css">.table {table-layout:fixed;}</style> -->
</head>

<body class="gray-bg">

<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-condition">
            <form id="sampleOrderReportForm" th:action="@{/samplePoController/samplelist}" class="form-inline">
                <div class="select-list">
                    <ul>
                        <li class="col-sm-3" style="width: 33%">
                            <label style="width: 120px">供应商编码：</label>
                            <input type="text" name="sapCode"/>
                        </li>
                        <li class="col-sm-3" style="width: 33%">
                            <label style="width: 120px">物料编码：</label>
                            <input type="text" name="materialCode"/>
                        </li>

                        <li class="col-sm-3" style="width: 33%">
                            <label style="width: 120px">物料描述：</label>
                            <input type="text" name="materialDesc"/>
                        </li>
                        <li class="col-sm-3" style="width: 33%">
                            <button id="sampleOrderReportSearchBtn" type="button"
                                    class="btn btn-primary btn-rounded btn-sm"><i
                                    class="fa fa-search"></i>&nbsp;搜索
                            </button>
                            <button class="btn btn-warning btn-rounded btn-sm" type="reset"><i class="fa fa-eraser"></i>&nbsp;重置
                            </button>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-info order-table">

        </div>
        <table id="sampleOrderReport" data-mobile-responsive="true"></table>
    </div>
</div>
</div>


<!--引入公共js-->
<div th:include="common/onload_js :: onloadJS"></div>
<script type="text/javascript" th:src="@{/static/js/plugins/jquery-layout/jquery.layout-latest.js}"></script>


<script type="text/javascript">
    //面向对象
    var searcherBS = Searcher.createBS('#sampleOrderReport',
        [
            {checkbox: true},
            {title: '物料编码', field: 'materialCode'},
            {title: '物料描述', field: 'materialDesc'},
            {title: '试用次数', field: 'reason'},
            {title: '供应商编码', field: 'vendorCode'},
            {title: '供应商名称', field: 'vendorName'},
            {title: '创建日期', field: 'creationDate'},
            {title: '样品数量', field: 'count'},
            {title: '单位', field: 'measureUnit'},
            {title: 'SQE接单时间', field: "dDate"},
            {title: '预计完成时间', field: "estimatedFinishTime"},
            {
                title: '剩余原料意见', field: "materialIdea",
                formatter: function (value, row, index) {
                    var status = '';
                    if (value == '1') {
                        status = '退还供应商';
                    } else if (value == '2') {
                        status = '正常使用';
                    } else if (value == '3') {
                        status = '报废';
                    }
                    return status;
                }
            },
            {
                title: '产品意见', field: "trialIdea",
                formatter: function (value, row, index) {
                    var status = '';
                    if (value == '1') {
                        status = '正常使用';
                    } else if (value == '2') {
                        status = '特采使用';
                    } else if (value == '3') {
                        status = '重工';
                    } else if (value == '4') {
                        status = '报废';
                    }
                    return status;
                }
            },
            {
                title: '试用结果', field: "trialIdea",
                formatter: function (value, row, index) {
                    var status = '';
                    if (value == '1') {
                        status = '扩大量再试用';
                    } else if (value == '2') {
                        status = '可以使用';
                    } else if (value == '3') {
                        status = '不可以使用';
                    } else if (value == '4') {
                        status = '改善再试';
                    }
                    return status;
                }
            },
        ]
    );


</script>
</body>
</html>
